#define _CRT_SECURE_NO_WARNINGS 1
#include "Function_C++_Programming_module.h"

//int main()
//{
//	//calling();
//	//protos();
//	//twoarg();
//	//lotto();
//	//arrfun1();
//	//arrfun2();
//	arrfun3();
//	return 0;
//}

const int ArSize = 8;
int sum_arr(const int* begin, const int* end)
{
	const int* pt;
	int total = 0;

	for (pt = begin; pt != end; pt++)
	{
		total = total + *pt;
	}
	return total;
}
int main()
{
	int cookies[ArSize] = { 1,2,4,8,16,32,64,128 };

	int sum = sum_arr(cookies, cookies + ArSize);
	cout << "Total cookies eaten: " << sum << endl;
	sum = sum_arr(cookies, cookies + 1);
	cout << "First three eaters ate: " << sum << " cookies." << endl;
	sum = sum_arr(cookies + 4, cookies + 8);
	cout << "Last four eaters ate " << sum << " cookies.\n";
	return 0;
}